package com.yanqu.road.server.cmd.activity.celebration;

import com.yanqu.road.pb.celebration.CelebrationProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.celebration.CelebrationMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

/**
 * @Description
 * @Author cwq
 * @Data 2022/4/24 16:01
 */
@Cmd(code = Protocol.C2_CELEBRATION_SYN_BUILD_TOTAL_LV, desc = "同步庆典建筑等级")
public class CrossCelebrationSynBuildLv extends CrossCommand {

    int activityId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CelebrationProto.CelebrationSynBuildLvGameToCrossMsg reqMsg = CelebrationProto.CelebrationSynBuildLvGameToCrossMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CelebrationMgr.synBuildLv(activityId, serverId, packet.getPlayerId());
    }

    @Override
    public void sendData() {

    }
}
